
package client;

import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import javax.xml.ws.WebServiceRef;


@ManagedBean
@RequestScoped
public class WSAdd {
    @WebServiceRef(wsdlLocation = "WEB-INF/wsdl/localhost_8080/Caculator/WSCaculatorService.wsdl")
    private WSCaculatorService service;
    private int a,b,c;

    public int getA() {
        return a;
    }

    public void setA(int a) {
        this.a = a;
    }

    public int getB() {
        return b;
    }

    public void setB(int b) {
        this.b = b;
    }

    public int getC() {
        return c;
    }

    public void setC(int c) {
        this.c = c;
    }

//    public int add(int a, int b){
//        return a+b;
//    }

    public void addNumber(){
        c = add(a,b);
    }
    private int add(int a, int b) {
        client.WSCaculator port = service.getWSCaculatorPort();
        return port.add(a, b);
    }

}
